package com.ljh.mall.controller;

import com.ljh.mall.mybatis.model.UmsMember;
import com.ljh.mall.service.MemberService;
import com.ljh.mall.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/member")
public class MemberContorller {

    @Autowired
    private MemberService memberService;
    @RequestMapping("/login")
    @ResponseBody
    public String login(Model model, UmsMember umsMember){
       UmsMember umsMember1 = memberService.selectMember(umsMember);
       if(umsMember1 != null){
           model.addAttribute("umsMember1",umsMember1);
           return model.toString();
       }else {
           return "会员不存在!";
       }

    }
}
